<?php

/**
*	隐藏帖子(伪删除,放入回收站)
*
*/

//包含公共文件
include '../../common/common.php';

//接收get传值,用于确定版块
// var_dump($_POST);

$arrId = $_POST['arrId'];
$strId = join(',' , $arrId);
// var_dump($arrId);
// var_dump($strId);

//修改数据库, 隐藏帖子,及隐藏其回复
$resDetail1 = myUpdate($link , DB_TABLE_DETAIL , ['isdel' => 1] , "id  in  ($strId)");
$resReply1 = myUpdate($link , DB_TABLE_DETAIL , ['isdel' => 1 , 'detaildel' => 1] , "tid  in  ($strId)");
// var_dump($resDetail1);
// var_dump($resReply1);

//判断帖子是否修改成功
if (!$resDetail1) {

	exit('回收失败 <a href="'  . $_SERVER['HTTP_REFERER'] .'">返回上一页</a>');
}

//跳转页面
echo '已放入回收站';
header('refresh:1;url=' . $_SERVER['HTTP_REFERER']);
